/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package manager.auxiliares;

import javax.swing.JPanel;

/**
 *
 * @author Thiago
 */
public class WindowsFunctions {


     public static void resizePanel(JPanel fatherPanel, JPanel childPanel) {

        double xPosition = (fatherPanel.getWidth() - childPanel.getWidth()) / 2;
        double yPosition = (fatherPanel.getHeight() - childPanel.getHeight()) / 2;

        fatherPanel.remove(childPanel);
        fatherPanel.add(childPanel);
        childPanel.setBounds((int) xPosition, (int) yPosition, childPanel.getWidth(), childPanel.getHeight());
    }

}
